package com.bestcem.xm.award.constant;

/**
 * Redis-Key
 *
 * @author hang.li <hang.li@idiaoyan.com>
 * @version v1.0
 * @date 2021/7/8 17:42
 */
public class RedisKeyConstant {

    /**
     * 短信验证码key前缀
     */
    public static final String SMS_AUTH_CODE_PREFIX = "award:draw:";

    /**
     * 短信验证码缓存时间:10分钟
     */
    public static final int SMS_AUTH_CODE_TIMEOUT = 10 * 60;

    /**
     * 短信请求频率key
     */
    public static final String SMS_FREQUENCY_KEY = "anti_fq_%s";

    /**
     * 短信请求频率时间: 58s
     */
    public static final int SMS_FREQUENCY_TIMEOUT = 58;

    /**
     * 抽奖过程加锁key
     */
    public static final String DRAW_AWARD_LOCK_KEY = "award:draw:lock:%s";

    /**
     * 领取红包入口页校验参数 settings.BONUS_KEY + request_id
     */
    public static final String RED_PACKET_ENTRY_KEY = "award:red:BONUS_KEY:%s";

    /**
     * 抽奖和红包 奖池 String.format("award:pool:%s", awardId)
     */
    public static final String AWARD_POOL = "award:pool:%s";

    /**
     * tempId加锁key String.format("award:award:lock:%s", tempId)
     */
    public static final String TEMP_ID_LOCK_KEY = "award:award:lock:%s";

    /**
     * 奖池 String.format(RedisKeyConstant.RED_PACKET_LOCK, awardId) award:bonus:lock:{award_id}
     */
    public static final String RED_PACKET_LOCK = "award:bonus:lock:%s";

    /**
     * 15分钟 单位:秒
     * 微信红包奖励 redisKey过期时间 15 * 60 = 900s
     */
    public static final int RED_PACKET_EXPIRE = 900;

    /**
     * 奖励修改状态 后跟id
     */
    public static final String AWARD_CHANGE_STATUS = "award:change_status:%s";

    /**
     * 奖励 新增，修改，修改状态，删除时 加orgId_projectId锁
     */
    public static final String AWARD_AWARD_OPERATE = "award:award:operate:%s_%s";

    /**
     * 品牌积分 新增，修改， 加orgId锁
     */
    public static final String BAND_POINT_OPERATE = "band:point:operate:%s";

    /**
     * 积分奖励总次数
     */
    public static final String AWARD_POINT_WAIT_COUNT = "award:point:wait:%s";

    /**
     * 积分奖励领取锁
     */
    public static final String AWARD_POINT_DRAW_LOCK = "award:point:draw:lock:%s";

    /**
     * 奖励通用验证结果保存
     */
    public static final String SMS_AUTH_CODE_RESULT_PREFIX = "award:draw:";
    /**
     * 奖励通用验证结果保存时间: 10*60s
     */
    public static final int SMS_AUTH_CODE_RESULT_TIMEOUT = 10 * 60;

    /**
     * 抽奖红包恢复奖池锁 后跟id
     */
    public static final String AWARD_RESTORE_POOL_KEY = "award:pool:restore:%s";

    /**
     * 奖励请求总数量
     */
    public static final String AWARD_REQUEST_STATS = "award:request:total:%s:%s";

    /**
     * 各个项目奖励个数统计
     */
    public static final String AWARD_COUNT_PROJECT = "award:count:project:%s:%s";

    /**
     * 奖励请求数量
     */
    public static final String AWARD_COUNT_REQUEST = "award:count:request:%s";

    /**
     * 奖励每日请求数量
     */
    public static final String AWARD_COUNT_DAY_REQUEST = "award:count:day:request:%s:%s";


}
